home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / What's New? / Development Kits / Mac OS / USB DDK 1.4.6f4 / Examples / USBSampleStorageDriver / UnitTableDriver / USB_ShimServicesSupport.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-25  |  1.2 KB  |  46 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        USB_ShimServicesSupport.c
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #include "USB_ShimServicesSupport.h"
  13.  
  14. static StorageClassShimDispatchTablePtr                gTheShimDispatchTable;
  15. static UInt8                                        currentDialog = 0;
  16. static DriverRefNum                                    gUTDrvrRefNum;
  17.  
  18. void SetShimDispatchTable( DriverRefNum drvrRefNum, StorageClassShimDispatchTablePtr newValue )
  19. {
  20.     gUTDrvrRefNum = drvrRefNum;
  21.     gTheShimDispatchTable = newValue;
  22. }
  23.  
  24. void ShowPleaseEjectMediaDialog( void )
  25. {
  26.     currentDialog = kUSBStorageEventRemoveManualEjectMedia;
  27.     gTheShimDispatchTable->DisplayDialog( gUTDrvrRefNum, kUSBStorageEventRemoveManualEjectMedia );
  28. }
  29.  
  30. void SendMediaWasRemovedEvent( void )
  31. {
  32.     currentDialog = kUSBStorageEventManualEjectMediaWasRemoved;
  33.     gTheShimDispatchTable->DisplayDialog( gUTDrvrRefNum, kUSBStorageEventManualEjectMediaWasRemoved );
  34. }
  35.  
  36. void ShowUnusableMediaDialog( void )
  37. {
  38.     currentDialog = kUSBStorageEventUnusableMediaEjected;
  39.     gTheShimDispatchTable->DisplayDialog( gUTDrvrRefNum, kUSBStorageEventUnusableMediaEjected );
  40. }
  41.  
  42. void RemoveCurrentDialog ( void )
  43. {
  44.     gTheShimDispatchTable->RemoveDialog( gUTDrvrRefNum, currentDialog );
  45. }
  46.